close all
clear all

data_path='C:\tmpdata\'; 

[data, header, template] = load_tiff_stack(-1,data_path);
disp('done loading the data!')

tic;
[data,dx,dy] = register_frames(data, mean(data(:,:,10:20),3));
disp('done aligning the data!')
toc

[data]=correct_line_shift(data,mean(data,3));
disp('done correcting line shifts!');

template=mean(data,3);

find_cells_gui(template);

bv=find_bv(template,1);
np=find_np(template,ROIs,bv);
disp('done finding ROIs!')

[ROIs,bv,np]=ROI_activity(data,ROIs,bv,np);
disp('done calculating activity!')

plot_activity_gen(ROIs,bv,np,template,'plot_aux_data');
